Skip to content

fix: safer saves, imports, settings writes and Windows agent starts - #37

Merged
nodemode-ai merged 16 commits into
mainfrom
fix/review-2026-11-28
Nov 29, 2026
Merged

nodemode-ai merged 16 commits into
mainfrom
fix/review-2026-11-28

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • A save never replaces a different movie. PUT /api/library/{name} answers 409 when the name only cleans into another movie's name, or differs from one only by case or Unicode form. The window picks free names the same way.
  • Import conversions read only the local file they are given. Every ffmpeg read passes -protocol_whitelist file, an import that starts as a text list of files is refused, and list file endings are stored as in.bin.
  • Settings writers read, change and write settings.json under one lock, and each write uses its own part file. Choosing a library folder no longer undoes an agents or voice setting made while the copy ran.
  • On Windows an npm .cmd shim is started as the program or node script it names, without the command interpreter. Another .cmd or .bat still goes through the interpreter, and each argument is checked: quotes become apostrophes; % and control characters are refused; & | < > ^ ! ( ) are refused unless the word is quoted; & | < > ^ are refused in every argument when the program path has a space. A name ending in dots or spaces counts as a .cmd, and a node that is itself a .cmd is never used. A refused version check now reports the program as broken instead of raising an error. The shared agent finder moves to 1.0.2, with its hash recorded.
  • Tests: backend tests for library twin names, import inputs, settings writers and Windows starts, plus a frontend unit test for free names.
  • Decisions are recorded in backend/HASHOUT_LOG.md and frontend/HASHOUT_LOG.md.
  • Windows: a .cmd or .bat that is not an npm shim runs through the command interpreter with /d, and any word (the program path included) containing & | < > ^ ( ) ! % " or a control character is refused, with or without spaces; the message points to standard input or a file for long text. npm shims still start directly with no interpreter.
  • Import conversions read only real media containers: the probe is held to a container allowlist, list and manifest containers are refused, and the conversion is pinned with -f to the probed container and given -protocol_whitelist file,pipe.
  • Shared agent finder 1.0.2 hash updated in setup/agents.py.

Tests

  • Each fix has a test that fails on the previous code where practical.
  • The repo CI commands were run locally on macOS. Every failure seen locally also fails on main in the same environment (missing local tools or platform-specific tests); none is introduced here.
  • Please rely on this PR's CI run for Linux and Windows.

For the owner

  • A few related items need an owner decision; they are listed separately, not here.

How to ship

  • Independent of other repos; merge in any order. No version bump; release as usual.

…heck arguments that still need it

An npm .cmd shim is started as the program or node script it names. Another .cmd or .bat keeps the interpreter, with quotes passed as apostrophes and %, control characters and unquoted special characters refused. Shared finder 1.0.2, hash recorded.
Pass -protocol_whitelist file to every ffmpeg read of an import, refuse an import that starts as a text list of files, and store list endings as in.bin.
…ndoes another

Choosing a library folder now records the choice after the copy against the settings as they are then. Each write uses its own part file.
When the program path is quoted, & | < > and ^ are refused in every argument. A name ending in dots or spaces counts as a .cmd or .bat, a shim whose node is itself a .cmd or .bat keeps the interpreter, and a refused version check reports the program as broken. Finder 1.0.2 hash updated.
….cmd

A .cmd or .bat that is not an npm shim still runs through the command interpreter, now with /d. Any word, the program path included, with & | < > ^ ( ) ! % " or a control character is refused whether or not it has spaces, and the message points to standard input or a file for long text. Words are passed unchanged. Finder 1.0.2 hash updated.
The probe is held to an allowlist of containers with -format_whitelist, a list or manifest container is refused, and the conversion is pinned with -f to the container the probe found and given -protocol_whitelist file,pipe.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:18
@nodemode-ai
nodemode-ai merged commit 0070f23 into main Nov 29, 2026
14 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants